import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
    {
        name: 'index',
        path: '/',
        redirect: '/main'
    },
    {
        name: 'main',
        path: '/main',
        component: () => import('@renderer/pages/Main.vue'),
        children: [
            {
                name: 'main_index',
                path: '',
                redirect: '/main/chat'
            },
            {
                name: 'chat',
                path: 'chat',
                component: () => import('@renderer/views/main/chat/Chat.vue'),
                children: [
                    {
                        name: 'chattingView',
                        path: ':id',
                        component: () => import('@renderer/views/main/chat/ChattingView.vue')
                    }
                ]
            },
            {
                name: 'pan',
                path: 'pan',
                component: () => import('@renderer/views/main/pan/pan.vue')
            },
            {
                name: 'Zone',
                path: 'Zone',
                component: () => import('@renderer/views/main/zone/Zone.vue')
            }
        ]
    },
    {
        name: 'login',
        path: '/login',
        component: () => import('@renderer/pages/Login.vue')
    },
    {
        name: 'setting',
        path: '/setting',
        component: () => import('@renderer/pages/Setting.vue')
    }
]

const router = createRouter({
    routes,
    history: createWebHashHistory()
})

export default router
